import { WPageProps } from '@/types/WLib'
import WPage from './index.vue'
import { render } from 'vue'

export default function useWpage(dom: HTMLElement, options: WPageProps, slots?: any) {
  // 判断是否存在dom
  if (!dom) {
    return console.error('节点不存在,请检查传入的dom节点是否存在')
  }

  const compontents = h(WPage, { ...options }, slots)

  // 渲染组件
  render(compontents, dom)
}
